﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AMS.DataAccess.Trademark.Interfaces;
using AMS.DataAccess.Trademark.Filters;
using AMS.DataAccess.Trademark.BO;

public partial class Trademark_GetTrademarkDlg : BaseWorkPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DoDataBind();
        }
    }

    int TrademarkID
    {
        set { ViewState["TrademarkID"] = value; }
        get { return ViewState["TrademarkID"] == null ? 0 : (int)ViewState["TrademarkID"]; }
    }

    private void DoDataBind()
    {
        ITrademarkManager mgr = ManagerFactory.CreateTrademarkManager();
        TrademarkFilter filter = new TrademarkFilter();
        List<TrademarkInfo> tmList = mgr.GetTrademarkList(CallContext, filter);
        gv.DataSource = tmList;
        gv.DataBind();
    }

    protected string FormatDateTime(object value)
    {
        return Utils.FormateDateTime(value, false);
    }

    protected void btnSelect_Command(object sender, CommandEventArgs e)
    {
        int itemIndex = int.Parse(e.CommandArgument.ToString());
        //TrademarkID = int.Parse(gv.DataKeys[itemIndex].Value.ToString());
        //lblTrademarkName.Text = gv.Rows[itemIndex].Cells[1].Text;
        //hfTrademarkID.Value = gv.DataKeys[itemIndex].Value.ToString();
    }
}
